<?php
header('content-type:text/html; charset=utf-8');
@$id = $_REQUEST['id'];
?>


<!DOCTYPE html>
<html>
   <head>
      <title>登录页面</title>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link href="css/bootstrap.min.css" rel="stylesheet">
      <script src="js/jquery-1.11.1.min.js"></script>
      <script src="js/bootstrap.min.js"></script>
      <!--[if lt IE 9]>
         <script src="js/html5shiv.js"></script>
         <script src="js/respond.min.js"></script>
      <![endif]-->
	  <script type="text/javascript">
	  $.ajaxSetup({
		  	dataType:'JSON',
			error:function(){
				alert('连接错误');
			}
		});
	  $(function(){
		  var url = '<?php echo $id?>';
		  console.log(url);
			$('#but').click(function(){
// 				if($('#lgninp').val().trim()==''||$('#pwdinp').val().trim()==''){
// 					alert('账号和密码都不能为空');
// 				}
				$.get('login1.php',$('form').serialize(),function(w){
					if(!w.status){
						$('#but1').html(w.info);
						$('#but1').css({'display':'block'});
						setTimeout("$('#but1').css({'display':'none'})",3000);
					} else {
						location.href="/login.php?id=3";
					}
				});
			});
			$('#butt').click(function(){
// 				if($('#lgninp').val().trim()==''||$('#pwdinp').val().trim()==''){
// 					alert('账号和密码都不能为空');
// 				}
				$.get('reg.php',$('form').serialize(),function(w){
					if(!w.status){
						$('#butt1').html(w.info);
						$('#butt1').css({'display':'block'});
						setTimeout("$('#butt1').css({'display':'none'})",3000);
					} else {
						$('.reg1').css({'display':'none'});
						$('.reg2').css({'display':'block'});
					}
				});
			});
			var arr = [];
			var g = 0;
			if (url==3){
				setInterval(function(){
					arr.push('|');
					$('#ldg').html(arr.join(''));
					g++;
					if (g==52||g==104){
						arr = [];
					}
					if (g==156){
						location.href="/login.php?id=2";
					}
				},50);
			}
			if (url==9){
				setInterval(function(){
					arr.push('|');
					$('#ldg1').html(arr.join(''));
					g++;
					if (g==53){
						arr = [];
						g = 0;
					}
				},50);
			}
			if (url==8){
				$.post('logout.php',function(y){
					
				});
				setInterval(function(){
					arr.push('|');
					$('#ldg').html(arr.join(''));
					g++;
					if (g==52||g==104){
						arr = [];
					}
					if (g==156){
						location.href="/login.php";
					}
				},50);
			}
			if (url==4){
				$.get('look.php',function(w){
					if(!w.status){
						$('.blc').html(w.info);
						console.log(w.info);
					} else {
						$('#blc').html(+w.money);
					}
				});
			}
			if (url==7){
				$.post('logout.php',function(y){
					
				});
				setInterval(function(){
					arr.push('|');
					$('#ldg').html(arr.join(''));
					g++;
					if (g==52||g==104){
						arr = [];
					}
					if (g==156){
						location.href="/login.php";
					}
				},50);
			}
			$('#verify').click(function(){
				if ($('#outinp').val().trim()==''){
					$('.fa').html('取款金额不能为空　请正确输入取款金额');
				}
				if (isNaN($('#outinp').val())){
					$('.fa').html('取款金额必须是数字　请正确输入取款金额');
				}
				if ($('#outinp').val()<0){
					$('.fa').html('取款金额不能为负数　难道你是想存钱？');
				}
				$.get('get.php',$('form').serialize(),function(d){
					console.log(d);
					if(!d.status){
						$('.fa').html(d.info);
					} else {
						$('.money').html(d.money);
						$('#incash').css({'display':'none'});
						$('.made').css({'display':'block'});
					}
				});
			})
			$('#verify1').click(function(){
				if ($('#addinp').val().trim()==''){
					$('.fa').html('存款金额不能为空　请正确输入存款金额');
				}
				if (isNaN($('#addinp').val())){
					$('.fa').html('存款金额必须是数字　请正确输入存款金额');
				}
				if ($('#addinp').val()<0){
					$('.fa').html('存款金额不能为负数　难道你是想取钱？');
				}
				$.get('add.php',$('form').serialize(),function(r){
					console.log(r);
					if(!r.status){
						$('.fa').html(r.info);
					} else {
						$('.money').html(r.money);
						$('#incash').css({'display':'none'});
						$('.made').css({'display':'block'});
					}
				});
			})
			$('.made').css({'display':'none'});
			$('#butt1').css({'display':'none','font-width':'bold','font-size':'20px'});
			$('#but1').css({'display':'none'});
			$('.reg2').css({'display':'none'});
			$('#but1').css({'font-width':'bold','font-size':'20px'});
		})
	  </script>
	  <style type="text/css">
	  	body{ padding-top: 30px; background-color:#5B5B5B; }
		form{ padding-top: 10px; }
		#login{ width:150px; }
		#login1{ width:150px; }
		#c{ text-align:right; font-size:40px; }
		#q{ text-align:right; font-size:40px; }
		#cn{ text-align:right; font-size:40px; }
		#t{ text-align:right; font-size:40px; }
		#loading{ font-size:40px; }
		#ldg{ font-size:40px; }
		#ldg1{ font-size:40px; color:red; }
		#report{ color:red; font-size:18px; }
		.c{ color:black; }
		.q{ color:black; }
		.cn{ color:black; }
		.t{ color:black; }
		#bu{ color:black; }
		#bu1{ color:black; }
		#bu2{ color:black; }
		#bu3{ color:black; }
		.bu{ font-size:40px; }
		.bu1{ font-size:40px; }
		.bu2{ font-size:40px; }
		.bu3{ font-size:40px; }
		.blc{ text-align:center; font-size:50px; color:red; }
		.ma{ text-align:center; font-size:50px; }
		.fa{ text-align:center; font-size:25px; color:red; }
		.gif{ text-align:center; }
		.money{ color:blue; }
		.reg2{ text-align:center; font-size:50px; }
		#blc{ color:blue; }
		.container{ height:770px; width:1400px; }
		.r{ border:solid 30px #c0c0c0; height:680px; background:url(/img/index_05.jpg); }
		.lo{ border:solid 30px #c0c0c0; height:680px; background-color:#005AB5; }
		.ui{ border:solid 30px #c0c0c0; height:680px; background-color:#FFFFFF; }
		.tips{ color:red;  }
		.form-group{ font-size:20px; }
		.form-control{ height:30px; }
		.text{ text-align:right; color:mediumvioletred; font-size:60px; }
		.we{ border:solid 1px blue; }
	  </style>
   </head>
   <body>
   <div class="container">
   <div class="row">
   <div class="col-md-2 col-md-offset-0 col-sm-2 col-sm-offset-0">
   		<br><br><br><br><br>
   		<div class="img">
   		<div class="thumbnail">
   			<img src="img/an3.fw.png">
   		</div>
   		</div>
   		<br><br><br>
   		<div class="img">
   		<div class="thumbnail">
   			<img src="img/an3.fw.png">
   		</div>
   		</div>
   		<br><br><br>
   		<div class="img">
   		<div class="thumbnail">
   			<img src="img/an3.fw.png">
   		</div>
   		</div>
   		<br><br><br>
   		<div class="img">
   		<div class="thumbnail">
   			<img src="img/an3.fw.png">
   		</div>
   		</div>
   	</div>
   <?php if (empty($id)){?>
   	<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
   		<div class="r">
   			<div class="text">宇宙星河银行<div>欢　迎　你</div></div>
   				<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
					<div class="col-md-7 col-md-offset-0 col-sm-5 col-sm-offset-0">
   						<div class="tips">
   							<h3>tips：我行已实现可账号登录ATM机,用户只需点击右方的”账号登录“按钮即可使用账号登录ATM机，当然-你也可以使用银行卡插入屏幕右侧的读卡口，验证信息后也可操作ATM机（只要你插得进去）。</h3>
						</div>
					</div>
				<br><br><br><br><br>
   			<div class="col-md-5 col-md-offset-0 col-sm-5 col-sm-offset-0">
   				<a href="login.php<?php echo "?id=1" ?>"><button class="btn btn-success" id="login">账号登录</button></a>
   				<a href="login.php"><button class="btn btn-success" id="login1">卡号登录</button></a>
			</div>
   		</div>
   	</div>
   	<?php } else if ($id==1){?>
   	<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      	<div class="lo">
      		<div class="row">
      			<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      				<div class="panel panel-primary" style="height:620px;">
						<div class="panel-heading">
   							<div class="title"><h4><span class="glyphicon glyphicon-ok"> 宇宙星河银行入口</span></h4></div>
						</div>
					<div class="panel-body">
						<button class="btn btn-primary btn-block" id="but1">　</button><br />
							<br><br><br><br><br><br>
                       	 	<form class="form-horizontal">
                            	<div class="form-group">
                                	<label class="control-label col-sm-4 col-md-4 col-lg-4 hidden-xs">登录名：</label>
                                	<div class="col-sm-7 col-md-8 col-lg-6">
                                    	<input id="lgninp" required="required" name="login" class="form-control" placeholder="登录名">
                                	</div>
                            	</div>
								<br><br><br><br>
                        		<div class="form-group">
                                	<label class="control-label col-sm-5 col-md-4 col-lg-4 hidden-xs">密　码：</label>
                                		<div class="col-sm-7 col-md-8 col-lg-6">
                                    		<input id="pwdinp" required="required" name="password" type="password" class="form-control" placeholder="密码">
                                		</div>
                            	</div>
                        	</form>
							<br><br><br><br>
                        <div class="row">
                        	<div class="col-md-4 col-md-offset-2 col-sm-5 col-sm-offset-4">
                        		<a href="login.php?id=10"><button class="btn btn-primary btn-block">注册新帐号</button></a>
							</div>
                            	<div class="col-md-4 col-md-offset-0 col-sm-5 col-sm-offset-0">
                               		<button class="btn btn-primary btn-block" id="but">登录</button>
                            	</div>
                        </div>
                      </div>
                    </div>
                 </div>
               </div>
            </div>
		</div>
		<?php } else if ($id==3){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="ui">
      			<div class="row">
      				<div class="col-md-10 col-md-offset-2 col-sm-6 col-sm-offset-0">
      					<br><br><br><br><br><br><br><br><br><br>
						<div id="loading">正在读取用户信息　请稍候·······</div>
						<br><br><br>
						<div id="ldg"></div>
      				</div>
      			</div>
      		</div>
      	</div>
		<?php } else if ($id==2){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="lo">
      			<div class="row">
      				<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      					<div class="panel panel-primary" style="height:620px;">
							<div class="panel-heading">
   								<div class="title"><h4><span class="glyphicon glyphicon-ok"> 主页面</span></h4></div>
							</div>
						<div class="panel-body">
							<div id="f" class="col-md-3 col-md-offset-0 col-sm-4 col-sm-offset-0">
								<div class="bu"><a href="login.php?id=9" id="bu">紧急报警</a></div>
									<br><br><br><br><br>
									<div class="bu1">理　　财</div>
									<br><br><br><br><br>
									<div class="bu2">转　　账</div>
									<br><br><br><br><br>
								<div class="bu3"><a href="login.php?id=8" id="bu3">取　　卡</a></div>
							</div>
							<div class="col-md-6 col-md-offset-0 col-sm-4 col-sm-offset-0">
								<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
								<div id="report">tips：如你遇到抢劫时亦或其它紧急情况时，可点击左上方的“紧急报警”按钮，ATM机会迅速将信息传递给宇宙报警中心，星际警察会已最快速度到达报警地点。</div>
							</div>
							<div id="f" class="col-md-3 col-md-offset-0 col-sm-4 col-sm-offset-0">
								<div id="c"><a href="login.php?id=4" class="c">查询余额</a></div>
								<br><br><br><br><br>
								<div id="q"><a href="login.php?id=5" class="q">取　　款</a></div>
								<br><br><br><br><br>
								<div id="cn"><a href="login.php?id=6" class="cn">存　　款</a></div>
								<br><br><br><br><br>
								<div id="t"><a href="login.php?id=7" class="t">退　　出</a></div>
							</div>
						</div>
					</div>
      			</div>
      		</div>
      	</div>
	</div>
		<?php } else if ($id==4){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="lo">
      			<div class="row">
      				<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      					<div class="panel panel-primary" style="height:620px;">
							<div class="panel-heading">
   								<div class="title"><h4><span class="glyphicon glyphicon-ok"> 查询余额</span></h4></div>
							</div>
							<div class="panel-body">
								<br><br><br><br>
								<div class="blc">你的余额为：<span id="blc"></span> 元</div>
								<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
								<a href="login.php?id=2"><button class="btn btn-primary btn-block" id="back">返回</button></a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php } else if ($id==5){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="lo">
      			<div class="row">
      				<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      					<div class="panel panel-primary" style="height:620px;">
							<div class="panel-heading">
   								<div class="title"><h4><span class="glyphicon glyphicon-ok"> 取款</span></h4></div>
							</div>
							<div class="panel-body">
								<div id="incash">
								<br><br>
								<div class="fa">　</div><br><br>
								<form class="form-horizontal">
                            		<div class="form-group">
                                		<label class="control-label col-sm-4 col-md-4 col-lg-2 hidden-xs">金额：</label>
                                			<div class="col-sm-7 col-md-8 col-lg-6">
                                    			<input id="outinp" required="required" name="money" class="form-control" placeholder="请输入取款金额">
                                			</div>
                           			 </div>
                       			 </form>
								 	<br><br><br>
								 	<div class="col-md-4 col-md-offset-4 col-sm-5 col-sm-offset-4">
								 		<button class="btn btn-primary btn-block" id="verify">确认</button>
									</div>
									<br><br><br><br><br><br><br><br><br><br><br><br>
                       			 	<a href="login.php?id=2"><button class="btn btn-primary btn-block" id="back">返回</button></a>
									</div>
								 <div class="made">
								 	<div class="ma">取款成功<div>你的现有余额为：<span class="money"></span> 元</div></div>
									<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
									<a href="login.php?id=2"><button class="btn btn-primary btn-block" id="back">返回主页面</button></a>
								 </div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php } else if ($id==6){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="lo">
      			<div class="row">
      				<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      					<div class="panel panel-primary" style="height:620px;">
							<div class="panel-heading">
   								<div class="title"><h4><span class="glyphicon glyphicon-ok"> 存款</span></h4></div>
							</div>
							<div class="panel-body">
								<div id="incash">
								<br><br>
								<div class="fa">　</div><br><br>
								<form class="form-horizontal">
                            		<div class="form-group">
                                		<label class="control-label col-sm-4 col-md-4 col-lg-2 hidden-xs">金额：</label>
                                			<div class="col-sm-7 col-md-8 col-lg-6">
                                    			<input id="addinp" required="required" name="money" class="form-control" placeholder="请输入存款金额">
                                			</div>
                           			 </div>
                       			 </form>
								 	<br><br><br>
								 	<div class="col-md-4 col-md-offset-4 col-sm-5 col-sm-offset-4">
								 		<button class="btn btn-primary btn-block" id="verify1">确认</button>
									</div>
									<br><br><br><br><br><br><br><br><br><br><br><br>
                       			 	<a href="login.php?id=2"><button class="btn btn-primary btn-block" id="back">返回</button></a>
								</div>
								 <div class="made">
								 	<div class="ma">存款成功<div>你的现有余额为：<span class="money"></span> 元</div></div>
									<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
									<a href="login.php?id=2"><button class="btn btn-primary btn-block" id="back">返回主页面</button></a>
								 </div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php } else if ($id==8){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="ui">
      			<div class="row">
      				<div class="col-md-10 col-md-offset-2 col-sm-6 col-sm-offset-0">
      					<br><br><br><br><br><br><br><br><br><br>
						<div id="loading">正在退卡　请收好你的卡片·······</div>
						<br><br><br>
						<div id="ldg"></div>
      				</div>
      			</div>
      		</div>
      	</div>
		<?php } else if ($id==9){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="ui">
      			<div class="row">
      				<br>
      				<div class="gif">
      						<img alt="尼玛" src="img/004d.gif">
      					</div>
      				<div class="col-md-10 col-md-offset-2 col-sm-6 col-sm-offset-0">
      					<br><br><br><br><br><br>
						<div id="loading">遭老 传递失败 正在努力重新尝试</div>
						<br><br><br>
						<div id="ldg1"></div>
      				</div>
      			</div>
      		</div>
      	</div>
		<?php } else if ($id==7){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      		<div class="ui">
      			<div class="row">
      				<div class="col-md-10 col-md-offset-2 col-sm-6 col-sm-offset-0">
      					<br><br><br><br><br><br><br><br><br><br>
						<div id="loading">正在退出　稍安勿躁················</div>
						<br><br><br>
						<div id="ldg"></div>
      				</div>
      			</div>
      		</div>
      	</div>
		<?php } else if ($id==10){?>
		<div class="col-md-8 col-md-offset-0 col-sm-5 col-sm-offset-0">
      	<div class="lo">
      		<div class="row">
      			<div class="col-md-12 col-md-offset-0 col-sm-5 col-sm-offset-0">
      				<div class="panel panel-primary" style="height:620px;">
						<div class="panel-heading">
   							<div class="title"><h4><span class="glyphicon glyphicon-ok"> 注册新帐号</span></h4></div>
						</div>
					<div class="panel-body">
						<div class="reg1">
						<button class="btn btn-primary btn-block" id="butt1">　</button>
							<br><br><br>
                       	 	<form class="form-horizontal">
                            	<div class="form-group">
                                	<label class="control-label col-sm-5 col-md-4 col-lg-4 hidden-xs">新登录名：</label>
                                	<div class="col-sm-7 col-md-8 col-lg-6">
                                    	<input id="lgninp" required="required" name="login" class="form-control" placeholder="请输入新登录名">
                                	</div>
                            	</div>
								<br><br>
                        		<div class="form-group">
                                	<label class="control-label col-sm-5 col-md-4 col-lg-4 hidden-xs">新 密 码：</label>
                                		<div class="col-sm-7 col-md-8 col-lg-6">
                                    		<input id="pwdinp" required="required" name="password" type="password" class="form-control" placeholder="请输入新密码">
                                		</div>
                            	</div>
                            	<br><br>
                            	<div class="form-group">
                                	<label class="control-label col-sm-5 col-md-4 col-lg-4 hidden-xs">再次输入新密码：</label>
                                		<div class="col-sm-7 col-md-8 col-lg-6">
                                    		<input id="pwdinp" required="required" name="newpassword" type="password" class="form-control" placeholder="请再次输入新密码">
                                		</div>
                            	</div>
                        	</form>
							<br><br><br>
                        <div class="row">
                             <div class="col-md-4 col-md-offset-6 col-sm-5 col-sm-offset-4">
                                 <button class="btn btn-primary btn-block" id="butt">确认</button>
                             </div>
                        </div>
                        <br><br><br>
                        <a href="login.php?id=1"><button class="btn btn-primary btn-block">返回</button></a>
						</div>
						<div class="reg2">
							<br><br>
							<div class="tips1">注册成功</div>
							<div>点击下方“返回”按钮返回登录页面</div>
							<br><br><br>
							<a href="login.php?id=1"><button class="btn btn-primary btn-block">返回登录页面</button></a>
						</div>
                      </div>
                    </div>
                 </div>
               </div>
            </div>
		</div>
		<?php }?>
		<div class="col-md-2 col-md-offset-0 col-sm-2 col-sm-offset-0">
   			<br><br><br><br><br>
   			<div class="img">
   			<div class="thumbnail">
   				<img src="img/an2.fw.png">
   			</div>
   			</div>
   			<br><br><br>
   			<div class="img">
   				<div class="thumbnail">
   					<img src="img/an2.fw.png">
   				</div>
   			</div>
   			<br><br><br>
   			<div class="img">
   				<div class="thumbnail">
   					<img src="img/an2.fw.png">
   				</div>
   			</div>
   			<br><br><br>
   			<div class="img">
   				<div class="thumbnail">
   					<img src="img/an2.fw.png">
   				</div>
   			</div>
   		</div>
		</div>
	</div>
   </body>
</html>